/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* 容器布局 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    margin-top: 20px;
}

/* 标题样式 */
h1 {
    text-align: center;
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 28px;
}

/* 消息提示样式 */
.messages {
    margin-bottom: 20px;
}

.message {
    padding: 10px 15px;
    margin-bottom: 10px;
    border-radius: 4px;
    background-color: #e3f2fd;
    color: #1976d2;
    border-left: 4px solid #1976d2;
    transition: opacity 0.3s ease;
}

.message.fade-out {
    opacity: 0;
}

/* 筛选区域样式 */
.filter-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.filter-left {
    display: flex;
    align-items: center;
}

.filter-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-weight: bold;
    color: #555;
}

.filter-group select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    cursor: pointer;
}

/* 按钮样式 */
.new-task-btn {
    padding: 8px 16px;
    background-color: #28a745;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.new-task-btn:hover {
    background-color: #218838;
}

.save-btn {
    padding: 8px 16px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.save-btn:hover {
    background-color: #0056b3;
}

.cancel-btn {
    padding: 8px 16px;
    background-color: #6c757d;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.cancel-btn:hover {
    background-color: #545b62;
}

.edit-btn {
    padding: 4px 10px;
    background-color: #ffc107;
    color: #212529;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.edit-btn:hover {
    background-color: #e0a800;
}

.delete-btn {
    padding: 4px 10px;
    background-color: #dc3545;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.3s ease;
    margin-left: 5px;
}

.delete-btn:hover {
    background-color: #c82333;
}

/* 统计信息样式 */
.stats-section {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
    flex-wrap: wrap;
    gap: 15px;
}

.stat-item {
    flex: 1;
    min-width: 120px;
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
}

.stat-value.pending {
    color: #ff9800;
}

.stat-value.in-progress {
    color: #2196f3;
}

.stat-value.completed {
    color: #4caf50;
}

.stat-value.overdue {
    color: #f44336;
}

/* 任务列表样式 */
.tasks-section {
    margin-top: 20px;
}

.tasks-table {
    width: 100%;
    border-collapse: collapse;
}

.tasks-table th, .tasks-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.tasks-table th {
    background-color: #f8f9fa;
    font-weight: bold;
    color: #555;
}

.task-item:hover {
    background-color: #f8f9fa;
}

.task-title {
    font-weight: bold;
    color: #2c3e50;
}

.task-actions {
    white-space: nowrap;
}

/* 状态和优先级标签样式 */
.status-badge, .priority-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.status-badge.pending {
    background-color: #fff3cd;
    color: #856404;
}

.status-badge.in_progress {
    background-color: #d1ecf1;
    color: #0c5460;
}

.status-badge.completed {
    background-color: #d4edda;
    color: #155724;
}

.priority-badge.high {
    background-color: #f8d7da;
    color: #721c24;
}

.priority-badge.medium {
    background-color: #fff3cd;
    color: #856404;
}

.priority-badge.low {
    background-color: #d1ecf1;
    color: #0c5460;
}

.overdue-tag {
    color: #f44336;
    font-weight: bold;
    margin-left: 5px;
}

.no-tasks {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* 表单样式 */
.task-form {
    max-width: 800px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.form-group textarea {
    height: 150px;
    resize: vertical;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.task-meta {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    font-size: 14px;
    color: #666;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .filter-section {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .filter-right {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .stats-section {
        flex-direction: column;
    }
    
    .stats-section .stat-item {
        min-width: auto;
    }
    
    .tasks-table {
        display: block;
        overflow-x: auto;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions button, .form-actions a {
        width: 100%;
        text-align: center;
    }
}